package com.sky.controller.admin;

import com.sky.dto.SeriesDTO;
import com.sky.result.Result;
import com.sky.service.SeriesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 书籍系列
 * @Author: Qiuyan
 * @Date: 2025-04-13 10:58
 * @Version： 1.0
 **/

@RestController
@RequestMapping("/admin/series")
@Api(tags = "系列相关接口")
@Slf4j
public class SeriesController {

    @Autowired
    private SeriesService seriesService;

    /**
     * 新增系列
     * @param seriesDTO
     * @return
     */
    @PostMapping
    @ApiOperation("新增系列")
    public Result save(@RequestBody SeriesDTO seriesDTO) {
        log.info("新增系列：{}", seriesDTO);
        seriesService.saveWithBooks(seriesDTO);
        return Result.success();
    }
}
